package com.leetcode.partition14;

import java.io.*;

/**
 * @author `RKC`
 * @date 2022/1/22 9:09
 */
public class LC1332删除回文子序列 {

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String s = reader.readLine();
        writer.write(removePalindromeSub(s) + "\n");
        writer.flush();
    }

    public static int removePalindromeSub(String s) {
        for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) == s.charAt(s.length() - i - 1)) continue;
            return 2;
        }
        return 1;
    }
}
